<?php if(! defined("BASEPATH")) exit("No direct access allowed!");
	
class Active_model extends CI_Model {

	private $activedb='active';
    public function __construct()
   	{
       $this->load->database();
	    parent::__construct();
    }

    public function add_active($data){
		$result = $this->db->insert($this->activedb, $data);
        return $result;
    }
    public function modify_active($data){
		$result = $this->db->replace('active', $data);
        return $result;
    }
    public function get_active($active_id = FALSE)
    {
        if ($active_id === FALSE)
        {
            $query = $this->db->get('active');
            return $query->result_array();
        }

        $query = $this->db->get_where('active', array('active_id' => $active_id));
        return $query->row_array();
    }
    public function delete_active($id){
    	$this->db->where('activeid', $id);
		$result = $this->db->delete($activedb);
        return $result;
    }
}
?>